<%@include file="/include/head.jsp"%>
<f:view>
<h:form id="menu"><%@include file="/include/menu.jsp" %></h:form>
<h:form id="page">

<tr class="header">
	<td colspan="3" class="header-left">
		<table class="form">
			<tr><td class="titulo" colspan="3"><h:commandLink action="#{aluno.entrarMenu }" value="Alunos" /> :: Listar</td></tr>
			<tr>
				<th>Nome *</th>
				<td><h:inputText value="#{aluno.nome}" id="nome" maxlength="80" size="30"/></td>
			</tr>
			<tr>
				<th>Email *</th>
				<td><h:inputText value="#{aluno.email}" id="email" maxlength="80" size="30"/></td>
			</tr>
			<tr>
				<th>Sexo *</th>
				<td><h:selectOneRadio value="#{aluno.sexo}" id="sexo">
					<f:selectItem itemLabel="Feminino" itemValue="1"/>
					<f:selectItem itemLabel="Masculino" itemValue="2"/>
				</h:selectOneRadio></td>
			</tr>
		</table>
		<table>
			<tr>
				<td><div class="button">
					<h:commandLink value="Buscar" action="#{aluno.listar }" id="linkCadastrar"/>
				</div></td>
				<td><div class="button">
					<h:commandLink value="Cancelar" action="#{aluno.cancelar }" id="linkCancelar"/>
				</div></td>
			</tr>
		</table>
	</td>
	<td class="header-right">
		<%@include file="/include/avisos.jsp" %>
	</td>
</tr>

<c:if test="${not empty aluno.listaAlunos}">
	<tr><td colspan="4"><div align="center" class="header_line"></div></td></tr>
	<tr>
		<td colspan="4">
			<table align="center" class="listagem" cellpadding="0" cellspacing="0">
				<caption>Listagem de Alunos</caption>
				<tr class="linhaImpar">
					<td width="30%">Nome</td>
					<td width="40%">Email</td>
					<td width="30%">Sexo</td>
					<td></td>
				</tr>
				<c:forEach items="#{aluno.listaAlunos}" var="item" varStatus="status">
					<tr class="${status.index mod 2 == 0 ? 'linhaPar' : 'linhaImpar'}">
						<td><h:outputText value="#{item.nome}" id="nomeLista"/></td>
						<td><h:outputText value="#{item.email}" id="emailLista"/></td>
						<td><h:outputText value="#{item.sexoDetalhado}" id="sexoLista"/></td>
						<td nowrap="nowrap">
							<h:commandLink id="linkAlteracao" action="#{aluno.entrarAlteracao}" title="Alterar" >
								<h:graphicImage value="/include/icons/alterar.gif" />
								<f:param name="id" value="#{item.id}" />
							</h:commandLink>
							<h:commandLink id="linkRemocao" action="#{aluno.remover}" title="Remover" onclick="#{informacoes.confirmaRemocao}">
								<h:graphicImage value="/include/icons/delete.gif" />
								<f:param name="id" value="#{item.id}" />
							</h:commandLink>
						</td>
					</tr>
				</c:forEach>
			</table>
		</td>
	</tr>
</c:if>

</h:form></f:view>
<%@include file="/include/tail.jsp"%>